<!-- 宣传教育，公用列表组件 -->
<template>
	<view class="news-list">
		<view class="news-item" v-for="(item,index) in publicityList" :key="index" @tap="getDetail(item.id)">
			<up-image :src="item.surfacePlots[0]" height="160rpx" width="200rpx" radius="5"></up-image>
			
			<view class="news-info">
				<view class="news-title">{{item.title}}</view>
				
				<view class="bottom-info">
					<view class="org" v-if="infoType == '1'">
						<up-icon name="account" size="20"></up-icon>
						<view>{{item.orgName}}</view>
					</view>
					<view class="count">
						<up-icon name="eye" size="20"></up-icon>
						<view>{{item.pageView}}</view>
					</view>
					<view class="org" v-if="infoType == '2'">
						<view>{{item.createTime}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			publicityList: {
				type: Array,
				default: () => []
			},
			infoType: {
				type: String,
				default: ''
			}
		},
		methods: {
			getDetail(id) {
				this.$emit('getDetail', id)
			}
		}
	}
</script>

<style scoped lang="scss">
	.news-list {
		padding: 0 30rpx;
		color: $uni-text-color;
		font-size: 28rpx;
		
		.news-item {
			display: flex;
			align-items: center;
			border-bottom: 1px solid #eee;
			padding: 20px 0;
			.news-info {
				height: 160rpx;
				flex: 1;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				padding-left: 20rpx;
				
				.news-title {
					display: -webkit-box;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 2;
					overflow: hidden;
					text-overflow: ellipsis;
				}
				
				.bottom-info {
					display: flex;
					justify-content: space-between;
					align-items: center;
					font-size: 26rpx;
					color: $uni-text-color-grey;
					
					.org, .count {
						display: flex;
						align-items: center;
					}
					
					:deep(.u-iconfont) {
						color: $uni-text-color-grey !important;
					}
				}
			} 
		}
	}
</style>